package net.ozgul.chordmaster;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RectShape;
import android.os.Bundle;
import android.widget.ImageView;

public class Fretboard extends Activity {
	
   @Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		FretboardView view = new FretboardView(this);
		setContentView(view);
	}
   
    private static class FretboardView extends ImageView {

		public FretboardView(Context context) {
			super(context);
			setVerticalScrollBarEnabled(true);

	    }

	    protected void onDraw(Canvas canvas) {
	    	int x = 10;
	    	int y = 10;
	    	int width = 300;
	    	int height = 600;
	    	
	    	canvas.drawColor(Color.WHITE);
	    	
	    	RectShape shape = new RectShape();
	    	shape.resize(width, height);
	    	ShapeDrawable drawable = new ShapeDrawable(shape);
	    	drawable.setBounds(x, y, width, height);
	    	 
	    	Paint paint = new Paint();
	    	
	        paint.setStrokeWidth(2);
	    	paint.setStyle(Style.STROKE);
	    	paint.setColor(Color.BLACK);
	    	
	    	drawable.getPaint().set(paint);
	    	drawable.draw(canvas);
	    	
	        for (int i=0; i < 5; i++) {
	        	canvas.drawLine(x + (60*i), y, x + (60*i), height, paint);
	        }
	    }
    	
    }

}
